/*
 * Copyright 2020 eBlocker Open Source UG (haftungsbeschraenkt)
 *
 * Licensed under the EUPL, Version 1.2 or - as soon they will be
 * approved by the European Commission - subsequent versions of the EUPL
 * (the "License"); You may not use this work except in compliance with
 * the License. You may obtain a copy of the License at:
 *
 *   https://joinup.ec.europa.eu/page/eupl-text-11-12
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

import angular from 'angular';
import ngMaterial from 'angular-material';
import ngAnimate from 'angular-animate';
import uiRouter from '@uirouter/angularjs';
import ngIdle from '../../../npm_integrations/ng-idle';
import translate from 'angular-translate';
import 'angular-translate-loader-static-files';

import 'angular-translate-interpolation-messageformat';


import LocationConfig from './_bootstrap/_configs/locationConfig';
import TranslationConfig from './_bootstrap/_configs/translationConfig';
import RoutesConfig from './_bootstrap/_configs/routeConfig';
import IdleConfig from './_bootstrap/_configs/idleConfig';
import APP_CONTEXT from './app.constants.js';

import ThemingProvider from './app.theme.js';
import AppRouter from './app.router.js';

import MainController from './main.controller.js';
import AppController from './app.controller.js';

import redirect from './service/redirect.service';

import './service/logger/logger.module';
import './service/security/security.module';
import './service/settings/settings.module';

import ExpiredController from './common/expired.controller';
import IdleDialogController from './common/idle.dialog.controller';
import RedirectController from './redirect/redirect.controller';

angular.module('eblocker.sample', [
    ngMaterial,
    ngAnimate,
    uiRouter,
    translate,
    ngIdle,
    'eblocker.logger',
    'eblocker.settings',
    'eblocker.security'
])
    .config(LocationConfig)
    .config(TranslationConfig)
    .config(ThemingProvider)
    .config(RoutesConfig)
    .config(IdleConfig)
    .config(AppRouter)
    .constant('APP_CONTEXT', APP_CONTEXT)
    .controller('ExpiredController', ExpiredController)
    .controller('MainController', MainController)
    .controller('AppController', AppController)
    .controller('IdleDialogController', IdleDialogController)
    .controller('RedirectController', RedirectController)
    .factory('redirect', redirect);

